package cn.ghgj.yn.sort;

import javax.xml.transform.Source;

public class BubbleSort {
	public static void bubbleSort() {
		int[] intArray = {234,3434,343354,453,3434,345544545,45544};
		
		for(int ele:intArray) {
			System.out.print(ele+ " ");
		}
		System.out.println();
		
		
		for(int i=0; i<intArray.length-1; i++) {
			for(int j=0; j<intArray.length-1-i; j++) {
				if (intArray[j] > intArray[j+1]) {
					intArray[j+1] = intArray[j] + (intArray[j]=intArray[j+1])*0;
				}
			}
		}
		for(int ele:intArray) {
			System.out.print(ele+ " ");
		}
		System.out.println();
	}
	public static void main(String[] args) {
		bubbleSort();
	}
}
